function getData() {
    $.ajax({
        url: 'http://211.71.149.251:1104/user/user/index',
        method: 'POST',
        dataType: 'json',
        success: function (data) {
            let rows = '';
            data.forEach(user => {
                rows += `<tr>
                           <td>${user.id}</td>
                           <td>${user.name}</td>
                           <td>${user.age}</td>
                      </tr>`;
            });
            $('#user-data').html(rows);
        },
        error: function (jqXHR, textStatus, errorThrown) {
            console.log('请求失败，状态码: ', jqXHR.status);
            console.log('错误信息: ', errorThrown);
            alert('Failed to fetch data.');
        }
    });
}
